/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sccntbtipoconv")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sccntbtipoconv.findAll", query = "SELECT s FROM Sccntbtipoconv s"),
    @NamedQuery(name = "Sccntbtipoconv.findBySccntbtipoconvid", query = "SELECT s FROM Sccntbtipoconv s WHERE s.sccntbtipoconvid = :sccntbtipoconvid"),
    @NamedQuery(name = "Sccntbtipoconv.findByNombre", query = "SELECT s FROM Sccntbtipoconv s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Sccntbtipoconv.findByDescripcion", query = "SELECT s FROM Sccntbtipoconv s WHERE s.descripcion = :descripcion"),
    @NamedQuery(name = "Sccntbtipoconv.findByObservaciones", query = "SELECT s FROM Sccntbtipoconv s WHERE s.observaciones = :observaciones")})
public class Sccntbtipoconv implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sccntbtipoconvid")
    private Integer sccntbtipoconvid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 250)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sccntbtipoconvid")
    private Collection<Sccntbconvenio> sccntbconvenioCollection;

    public Sccntbtipoconv() {
    }

    public Sccntbtipoconv(Integer sccntbtipoconvid) {
        this.sccntbtipoconvid = sccntbtipoconvid;
    }

    public Sccntbtipoconv(Integer sccntbtipoconvid, String nombre, String descripcion, String observaciones) {
        this.sccntbtipoconvid = sccntbtipoconvid;
        this.nombre = nombre;
        this.descripcion = descripcion;
        this.observaciones = observaciones;
    }

    public Integer getSccntbtipoconvid() {
        return sccntbtipoconvid;
    }

    public void setSccntbtipoconvid(Integer sccntbtipoconvid) {
        this.sccntbtipoconvid = sccntbtipoconvid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Sccntbconvenio> getSccntbconvenioCollection() {
        return sccntbconvenioCollection;
    }

    public void setSccntbconvenioCollection(Collection<Sccntbconvenio> sccntbconvenioCollection) {
        this.sccntbconvenioCollection = sccntbconvenioCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sccntbtipoconvid != null ? sccntbtipoconvid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sccntbtipoconv)) {
            return false;
        }
        Sccntbtipoconv other = (Sccntbtipoconv) object;
        if ((this.sccntbtipoconvid == null && other.sccntbtipoconvid != null) || (this.sccntbtipoconvid != null && !this.sccntbtipoconvid.equals(other.sccntbtipoconvid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sccntbtipoconv[ sccntbtipoconvid=" + sccntbtipoconvid + " ]";
    }
    
}
